#FROM python:3.7-slim
FROM  python:3.9-slim

LABEL maintainer=""
LABEL version="2.10.1"

RUN  mkdir -p /app/server
ADD fast.py C.py dao.py poster.py R.py requirements.txt app.yml store.py start.sh  /app/server
RUN  mkdir -p /app/server/resource
COPY resource /app/server/resource
RUN  mkdir -p /app/server/data
COPY data /app/server/data
RUN  mkdir -p /app/design

RUN  mkdir -p /app/__pycache__
COPY design/ /app/design/
COPY __pycache__/ /app/__pycache__/

EXPOSE 5000

VOLUME /app/data

WORKDIR /app/server
#新增更新版本
RUN  python -m pip install --upgrade pip

RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
# RUN pip install -r requirements.txt

RUN rm -rf /usr/local/lib/python3.9/site-packages/flask_uploads.py
COPY flask_uploads.py /usr/local/lib/python3.9/site-packages/
ENV TOKEN="ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv"
# ENV SECRET_KEY="EJCwlrnv6QZ0PCdvrWGi"
ENV POSTER_URI_PREFIX="http://127.0.0.1:5000/"

#ENTRYPOINT ["/bin/bash", "start.sh"]
CMD ["/bin/bash", "start.sh"]
